<!DOCTYPE html>
<html >
   <head>
       <meta charset="utf-8">
   </head>
   <body s>
       <div id="container" style="height: 900px"></div>
       <script type="text/javascript" src="/graph-benchmark/views/js/echarts.js"></script>
       <script type="text/javascript">
var dom = document.getElementById("container");
var myChart = echarts.init(dom);
var app = {};
option = null;
app.title = '力引导布局';

//myChart.showLoading();

    //myChart.hideLoading();


    var categories = [];
    for (var i = 0; i < 9; i++) {
   
        categories[i] = {
            name: '类目' + i
        };
    }
    
    var nodes = []
    var edges = []
    for (var i = 0; i < 10; i++) {
	    	var node = {}
	    	node.id = i
	    	node.name = "hi"
	    	node.symbolSize = 10
	    	nodes.push(node)
    }
    for (var j = 0; j < 9; j++) {
	    	var edge = {}
	    	edge.id = j
	    	edge.source = j
	    	edge.target =  j+1
	    	edges.push(edge)
	}
 
    option = {
        title: {
            text: 'Les Miserables',
            subtext: 'Default layout',
            top: 'bottom',
            left: 'right'
        },
        tooltip: {},
        legend: [{
            // selectedMode: 'single',
            data: categories.map(function (a) {
                return a.name;
            })
        }],
        animation: false,
        series : [
            {
                name: 'Les Miserables',
                type: 'graph',
                layout: 'force',
                data: nodes,
                links: edges,
                categories: categories,
                roam: true,
                label: {
                    normal: {
                        position: 'right'
                    }
                },
                force: {
                    repulsion: 100
                }
            }
        ]
    };

    myChart.setOption(option);

if (option && typeof option === "object") {
    myChart.setOption(option, true);
}
       </script>
   </body>
</html>